package com.lik888.web1.entity;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ESTable {
    private Long goodsId;
    private String goodsType;
    private String goodsInfo;
    private String goodsName;
    private String goodsTitlephoto;
    private String goodsRegion;
    private Long goodsPrice;
    private Long goodsSale;
    private Integer goodsLook;
    private Integer goodsWant;
    private String goodsStatus;
    private List<String> Suggestion;


    public ESTable(GoodsTable goodsTable) {
        this.goodsId = goodsTable.getGoodsId();
        this.goodsType = goodsTable.getGoodsType();
        this.goodsInfo = goodsTable.getGoodsInfo();
        this.goodsName = goodsTable.getGoodsName();
        this.goodsTitlephoto = goodsTable.getGoodsTitlephoto();
        this.goodsRegion = goodsTable.getGoodsRegion();
        this.goodsPrice = goodsTable.getGoodsPrice();
        this.goodsSale = goodsTable.getGoodsSale();
        this.goodsLook = goodsTable.getGoodsLook();
        this.goodsWant = goodsTable.getGoodsWant();
        this.goodsStatus = goodsTable.getGoodsStatus().toString();
        //将类型 姓名 区服 加入建议列表
        this.Suggestion = Arrays.asList(goodsType, goodsName, goodsRegion);
    }
}
